#include<stdio.h>
#include<string.h>
char s[1000006];
int book[123];
int main()
{
	int i,j,k;
	int ip,jp,len=0,max=0;
	gets(s);
	jp=strlen(s);
	ip=0;
	for(i=0;s[i]!='\0'&&s[j]!='\0';i=k+1)
		for(j=i;s[j]!='\0';j++)
		{
			if(!book[s[j]])
			{
				book[s[j]]=1;
				len++;
			}
			else
			{
				for(k=i;k<=j;k++)
				{
					if(s[k]==s[j])
					break;
				}
				memset(book,0,sizeof(book));
				if(max<len)
				{
					max=len;
					ip=i;
					jp=j;
				}
				len=0;
				break;
			}
		}
	if(s[j]=='\0'&&max<len)
	{
		max=len;
		ip=i;
		jp=j;
	}
	s[jp]='\0';
	puts(s+ip);
	return 0; 
	
}
